<?php
	namespace Home\Model;
	use Think\Model;

	class HomeUserModel extends Model
	{
		//自动验证
		protected $_validate = array(
			array('add1',0,'请选择省份',0,'notequal'),
			array('add2',0,'请选择市/县',0,'notequal'),
			array('add3',0,'请选择县/区',0,'notequal'),
			array('add4','require','请填写具体地址'),
			array('username','require','请填写用户名！'),
	        array('username','6,50','用户名在6个字到50个字之间！',1,'length'),
	        array('mail','require','请输入邮箱'),
	        array('mail','email','请输入正确的邮箱'),
	        array('postcode','require','请填写邮编！'),
	        array('username','/^[0-9]{6}$/','邮编必须6位数字！',1,'length'),
			);
		//自动完成
		protected $_auto = array(
			array('add_time', 'getDate', Model:: MODEL_INSERT, 'callback'),
		);
		    // 获取当前日期时间
	    public function getDate()
	    {
	        return time();
	    }


	}